package com.neuedu.web.controller;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * @author 金山
 * 项目：javaweb
 * site: https://blog.fulfill.com.cn
 * 描述
 * @data 2024/11/1515:01
 *
 *
 * http://127.0.0.1:8080/web/scope_object
 */
@WebServlet("/scope_object")
public class ScopeObjectController extends HttpServlet {


    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        HttpSession session = req.getSession();
        ServletContext applicatoin = req.getServletContext();
        System.out.println(req);
        System.out.println(req.getSession());
        System.out.println(req.getServletContext());

        // req.setAttribute("");
        // session.setAttribute();
        // applicatoin.setAttribute();


    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doGet(req, resp);
    }
}
